<template>
  <a-config-provider
    :locale="zhCN"
    :theme="{
      token: {
        colorPrimary: colorPrimary,
        borderRadius: borderRadius,
      },
    }"
    :input="{ autocomplete: 'off' }"
  >
    <template #renderEmpty>
      <a-empty description="暂无内容" />
    </template>
    <router-view />
  </a-config-provider>
</template>
<script setup lang="ts">
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import { useThemeStore } from '@/stores/theme'
import routes from '@/router/routes'
import { useMenuStore } from '@/stores/menu'
import updateNprogressTheme from '@/utils/nprogress-theme'

const { colorPrimary, borderRadius } = storeToRefs(useThemeStore())
const { formatMenus } = useMenuStore()

formatMenus(routes)

watchEffect(() => {
  updateNprogressTheme(colorPrimary.value)
})
</script>

<style scoped lang="scss"></style>
